package com.wtf.dsp.admin.enums;

/**
 * ClassName: DbType
 * Description: 数据库类型
 * date: 2024/3/7 17:13
 *
 * @author linhuanyou
 * @version 1.0
 */
public enum DbType {

    MYSQL("mysql", "MySql数据库"),
    ORACLE("oracle", "Oracle11g及以下数据库(高版本推荐使用ORACLE_NEW)"),
    ORACLE_12C("oracle12c", "Oracle12c+数据库"),
    DB2("db2", "DB2数据库"),
    H2("h2", "H2数据库"),
    POSTGRE_SQL("postgresql", "Postgre数据库"),
    OTHER("other", "其他数据库" );

    private final String db;
    private final String desc;


    public static DbType getDbType(String dbType) {
      DbType[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            DbType type = var1[var3];
            if (type.db.equalsIgnoreCase(dbType)) {
                return type;
            }
        }
        return OTHER;
    }

    public String getDb() {
        return this.db;
    }

    public String getDesc() {
        return this.desc;
    }


    private DbType(final String db, final String desc) {
        this.db = db;
        this.desc = desc;
    }
}
